//
//  RHVideoCell.m
//  RuiHeAppApp
//
//  Created by Yan Chen on 2023/10/30.
//

#import "RHVideoCell.h"

@implementation RHVideoCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
        [self setupUI];
    }
    return self;
}
-(void)setupUI{
    self.contentView.backgroundColor = CFTabViewBgColor;
    UIView *top_bgView = kView;
    top_bgView.backgroundColor = [UIColor whiteColor];
    top_bgView.layer.cornerRadius = 8;
    top_bgView.layer.masksToBounds = YES;
    [self.contentView addSubview:top_bgView];
    [top_bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.insets(UIEdgeInsetsMake(15, 15, 0, 15));
        
    }];
    QMUILabel *titleLab = [[QMUILabel alloc]init];
    titleLab.text = @"如何创建电站".rh_localized;
    titleLab.font = [UIFont systemFontOfSize:15];
    titleLab.textColor = kCOLOR_HEX(@"3F4443");
    [top_bgView addSubview:titleLab];
    self.titleLab = titleLab;
    
    UIView *videoView = kView;
    [top_bgView addSubview:videoView];
    
    
    
    UIImageView *videoImg = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"server_video_placeholder"]];
    [videoView addSubview:videoImg];
    
    
    [titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.mas_offset(15);
        
    }];
    
    
    [videoView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.insets(UIEdgeInsetsMake(45, 15, 15, 15));
    }];
    
    [videoImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.insets(UIEdgeInsetsZero);
    }];
}
@end
